#!/usr/bin/env python
# -*- coding: utf-8 -*-

# thirdpart modules
from PyQt5.QtWidgets import (
    QVBoxLayout,
    QWidget,
)

# user defined
from .MdiChilds_ import MdiChild1 as MdiChild1_
from .MdiChilds_ import MdiChild2 as MdiChild2_
from .MdiChilds_ import MdiChild3 as MdiChild3_

class MdiChild1(QWidget):
    sequenceNumber = 1

    def __init__(self, title=None):
        super().__init__()

        self.window = MdiChild1_.Window(title)
        self.vbox = QVBoxLayout()
        self.vbox.addWidget(self.window)
        self.setLayout(self.vbox)
        cls = self.__class__
        self.setWindowTitle("%s:%d" % (cls.__name__, cls.sequenceNumber))
        cls.sequenceNumber += 1

class MdiChild2(QWidget):
    sequenceNumber = 1

    def __init__(self, title=None):
        super().__init__()

        self.window = MdiChild2_.Window(title)
        self.vbox = QVBoxLayout()
        self.vbox.addWidget(self.window)
        # self.vbox.addStretch(1)
        self.setLayout(self.vbox)
        cls = self.__class__
        self.setWindowTitle("%s:%d" % (cls.__name__, cls.sequenceNumber))
        cls.sequenceNumber += 1

class MdiChild3(QWidget):
    sequenceNumber = 1

    def __init__(self, title=None):
        super().__init__()

        self.window = MdiChild3_.Window(title)
        self.vbox = QVBoxLayout()
        self.vbox.addWidget(self.window)
        # self.vbox.addStretch(1)
        self.setLayout(self.vbox)
        cls = self.__class__
        self.setWindowTitle("%s:%d" % (cls.__name__, cls.sequenceNumber))
        cls.sequenceNumber += 1

if __name__ == '__main__':
    import sys
    from PyQt5.QtWidgets import QApplication

    app = QApplication(sys.argv)
    mainWin = MdiChild1()
    # mainWin = MdiChild2()
    # mainWin = MdiChild3()
    mainWin.show()
    sys.exit(app.exec_())
